package com.chee.plant.hibernate.object.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the farm_plant table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="farm_plant"
 */

public abstract class BaseFarmPlant  implements Serializable {

	public static String REF = "FarmPlant";
	public static String PROP_TYPE = "Type";
	public static String PROP_ID = "Id";
	public static String PROP_COORD_Y = "CoordY";
	public static String PROP_USER_ID = "UserId";
	public static String PROP_COORD_X = "CoordX";
	public static String PROP_USERPLANT_ID = "UserplantId";
	public static String PROP_GROW_TIME="GrowTime";


	// constructors
	public BaseFarmPlant () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseFarmPlant (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseFarmPlant (
		java.lang.Integer id,
		java.lang.Integer userId,
		java.lang.Integer type,
		java.lang.Integer coordX,
		java.lang.Integer coordY,
		java.lang.Integer userplantId,
		java.util.Date growTime
		) {

		this.setId(id);
		this.setUserId(userId);
		this.setType(type);
		this.setCoordX(coordX);
		this.setCoordY(coordY);
		this.setUserplantId(userplantId);
		this.setGrowTime(growTime);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer userId;
	private java.lang.Integer type;
	private java.lang.Integer coordX;
	private java.lang.Integer coordY;
	private java.lang.Integer userplantId;
	private java.util.Date growTime;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: user_id
	 */
	public java.lang.Integer getUserId () {
		return userId;
	}

	/**
	 * Set the value related to the column: user_id
	 * @param userId the user_id value
	 */
	public void setUserId (java.lang.Integer userId) {
		this.userId = userId;
	}



	/**
	 * Return the value associated with the column: type
	 */
	public java.lang.Integer getType () {
		return type;
	}

	/**
	 * Set the value related to the column: type
	 * @param type the type value
	 */
	public void setType (java.lang.Integer type) {
		this.type = type;
	}

	/**
	 * Return the value associated with the column: growTime
	 */
	public java.util.Date getGrowTime(){
		return growTime;
	}
	/**
	 * Set the value related to the column: growTime
	 * @param type the type value
	 */
	public void setGrowTime(java.util.Date growTime){
		this.growTime=growTime;
	}

	/**
	 * Return the value associated with the column: coord_x
	 */
	public java.lang.Integer getCoordX () {
		return coordX;
	}

	/**
	 * Set the value related to the column: coord_x
	 * @param coordX the coord_x value
	 */
	public void setCoordX (java.lang.Integer coordX) {
		this.coordX = coordX;
	}



	/**
	 * Return the value associated with the column: coord_y
	 */
	public java.lang.Integer getCoordY () {
		return coordY;
	}

	/**
	 * Set the value related to the column: coord_y
	 * @param coordY the coord_y value
	 */
	public void setCoordY (java.lang.Integer coordY) {
		this.coordY = coordY;
	}



	/**
	 * Return the value associated with the column: userplant_id
	 */
	public java.lang.Integer getUserplantId () {
		return userplantId;
	}

	/**
	 * Set the value related to the column: userplant_id
	 * @param userplantId the userplant_id value
	 */
	public void setUserplantId (java.lang.Integer userplantId) {
		this.userplantId = userplantId;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.FarmPlant)) return false;
		else {
			com.chee.plant.hibernate.object.FarmPlant farmPlant = (com.chee.plant.hibernate.object.FarmPlant) obj;
			if (null == this.getId() || null == farmPlant.getId()) return false;
			else return (this.getId().equals(farmPlant.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

private static final long serialVersionUID = 1L; 
}